package com.mlnx.push.websocket.server.topic;

/**
 * Created by amanda.shan on 2019/4/10.
 */
public class UserTopic extends Topic {

    private Integer userId;

    public UserTopic(TopicType topicType, Integer userId) {
        super(topicType);
        this.userId = userId;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    @Override
    public boolean equals(Object obj) {

        if (super.equals(obj)) {
            UserTopic topic = (UserTopic) obj;
            return (topic.userId.equals(userId));
        }
        return false;
    }

    @Override
    public String toString() {
        return topicType.toString()+":"+userId;
    }
}
